package com.itheima.tliasmanagementspringboot.service.impl;

import com.itheima.tliasmanagementspringboot.mapper.EmpLoginLogMapper;
import com.itheima.tliasmanagementspringboot.mapper.FileUploadLogMapper;
import com.itheima.tliasmanagementspringboot.pojo.EmpLoginLog;
import com.itheima.tliasmanagementspringboot.pojo.FileUploadLog;
import com.itheima.tliasmanagementspringboot.service.EmpLoginLogService;
import com.itheima.tliasmanagementspringboot.service.FileUploadLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class FileUploadLogServiceImpl implements FileUploadLogService {

    @Autowired
    private FileUploadLogMapper fileUploadLogMapper;

    //REQUIRES_NEW:不受外部的影响,需要加这个属性和参数
    @Transactional(propagation = Propagation.REQUIRES_NEW)//propagation:事务的传播行为,一个事务遇到另外一个事物,怎么处理的问题//REQUIRES_NEW开启新事物,独立运行
    @Override
    public void insert(FileUploadLog fileUploadLog) {
        fileUploadLogMapper.insert(fileUploadLog);
    }
}
